package com.wyg.epkafkastarter.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author: WangYongGan
 * @Date: 2022/5/17 20:46
 * @Description:
 */

@Component("kafkaConfigProperties")
@ConfigurationProperties(prefix = "ep.kafka")
@Data
public class KafkaConfigProperties implements InitializingBean {
    public static final String defaultUrl = "w3:19092";
    //kafka的url
    public static String url = defaultUrl;
    //kafka类型  0:消费型 1:生产型 2:消费+生产
    public static int type=2;
    private int type_=2;
    private String url_;


    @Override
    public void afterPropertiesSet() throws Exception {
        url = url_;
        type=type_;
    }
}
